home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
telecomm
/
uemlsrc.arc
/
uemail.mss
< prev
next >
Wrap
Text File
|
1987-08-24
|
38KB
|
617 lines
Uemail
Uemail is an emacs-like full-screen editor for the Atari-ST computer
equipped with a color or monochrome monitor. It supports all of the major
commands offered by microEmacs version 30, plus some extensions that make
its interface closer to that used by GNU_EMACS. Although smaller than
1ST_WORD and many GEM-based programs, uemail is a large program by TOS
standards. It was ported from a two megabyte 68K system and scaled down to
fit in the small memory of a 1040ST. It requires more than 128K to load.
To support shell commands, it returns 256K to the operating system at
startup. On the 68K system the shell command required only 12K of code and
128K of operating space and did not require loading a command processor to
get at the operating system. But since the ST has no command control
processor, you must load a shell program such as COMMAND.PRG or
PCOMMAND.PRG to get at the file system. You may run any TOS based program
from within the editor, but programs that require a GEM interface will
crash the system. You will have to exit the editor entirely to run GEM
programs as there is just not enough extra memory to run GEM programs.
Running uemail from within a shell program diminishes the available text
buffer space. The return TPA command (ESC-@) reports the amount of space
used and the amount available. Long source code files (900 or more lines)
are the biggest memory eaters. If uemail runs directly from the desktop,
buffer space is rarely a problem even with a 360K ramdisk loaded, but
running this program and trying to edit large files on a 520ST may be a
problem if ramdisks or numerous desk accessories are in memory. Files
consume approximately one and one-half times their physical size. Text
files consume a little less, and because program code often has a number of
blank lines for which space must be allocated, it consumes somewhat more
memory in relation to its size.
The main reason for the size of the program is the added kermit utility not
usually found in a text editor, and the aliasing system for loading text
files and shell programs. The disadvantage of tying these functions into
the program and using up memory space is outwayed by the advantage gained
by integration. The ability to transfer text directly into and out of an
editor buffer saves time and programming effort. The integrated program
also gives the programmer a relatively easy way to implement individual
protocol schemes to communicate with remote systems since all of the
readaux and sendaux functions are already defined. If the kermit section
and the terminal section were to be separate from the editor, then loading
those free standing programs into memory would require a larger shell space
as each of those programs would be linked to its own copy of the run-time
library. Finally, the additional features make the editor more of an
all-purpose tool, the type of program that can be loaded and serve as a
simple shell from which to carry out most tasks on the computer.
Uemail is designed to work in tandem with GNU_EMACS on a remote computer.
When the program is connected to the serial line, all of the function keys
and the number pad keys send the same commands as they do from within
uemail, and the defined keyboard macros (macros triggered by the accent
grave key) are also sent across the line. This allows you to set up special
function key definition files and macro definition files to use with a
remote emacs. Macro files can be loaded into memory from within an editor
buffer or while online using the terminal section.
In addition to the direct connect terminal section, uemail has a connect
mode which supports kermit protocol for 7-bit transfers between two
computers. This ability allows the editor to work with text from a remote
system and to transfer it back to that system when done. For remotes that
do not support the kermit protocol there are log and transfer commands
which use the ST's flow control (settable from within the terminal mode) to
transfer text without dropping characters (provided that the remote
supports one of the ST's handshaking protocols). Because the modem I have
does not support RTS/CTS, I have not been able to determine if it works as
well with an RTS/CTS protocol as it does with XON/XOFF. Uemail sets the
baud rate while in connect mode. At the beginning of the connect session,
the baud rate defaults to 1200 bps, but it can be reset to 300, 2400, 9600,
or 19200 bps. When uemail exits from terminal mode, it saves the terminal
screen. When it returns to terminal mode, it rewrites that screen placing
the cursor at its previous position. You cannot set parity or stop bits
from within the terminal section, if anyone finds this to be a problem, let
me know, and I'll figure a way to get around it. However, you can always
run a TOS-based modem program from within uemail that can set the additional
parameters. The sample alias file shows how to define an xmodem program
that will run when the CTRL-C command is given `xmodem' for a program name.
Macro commands are a quick way to automate repetitive tasks, and they also
may be used to send strings, such as dial commands or logon scripts, to a
modem. The limitations of the execute macro command (CTLX-E) in many
microemaxen are only one macro may be defined at a time, defining a new
macro kills the old one, macros cannot be saved across editing sessions,
and macros cannot be loaded from a disk file. Uemail overcomes these
limitations while retaining the "flavor" of the original define and execute
macro command. Any macro defined by the define macro command (CTLX-() may
be assigned to a key on the keyboard using the getmacro command (CTLX-`)
which will prompt for the key to bind. The current keyboard macro is
copied into a safe place in memory, and a pointer to it is stored in a
macro table (a dynamically allocated structure). From then on typing the
accent grave (`) key followed by the key that you assigned to that macro
will cause the appropriate macro to execute. Macros can then be saved to
disk, using the `-CTRL-M command, for later loading, using the `-CTRL-L
command. When the editor starts up, it attempts to load the file
UEMAIL.MCR default macro file from the default drive and path. The
off-line program EXTMAC reads a macro file and writes a C-code equivalent
of each function to a file. This external program, which can be run using
the shell command, replaces the old C-Mac buffer scheme in previous
versions and, unlike the earlier built-in function, will create C-code for
any defined macro.
Macro files may also be loaded from the terminal mode using the ALT-L
command. Macros are used in the terminal mode the same way as they are in
an editor buffer (by typing a ` followed by the appropriate character).
Macros are of two basic types: character strings and command strings.
Character strings are words that have been typed to the screen while
defining a macro. For example from within a buffer you can type the begin
macro command, type "ATDT5551234<CR>," followed by the end macro command
(CTLX-)), and the getmacro command (CTLX-`), binding this string to `5.
Then from the terminal section you can type `5 to send the string to your
modem. Command strings are macros which would normally cause uemail to
execute a series of commands (such as CTRL-A CTRL-O to go to the beginning
of the line and open a blank line above it). Command strings make the most
sense when uemail is serving as a terminal connection to a remote Emacs
editor, allowing you to define a set of macros that behave the same way in
both editors.
As of version 33 of uemail ST, the cc command is an off-line program which
runs in the space uemail returns to the operating system. The sample
start-up file (cc.ini) shows how to define an alias for CC.PRG which makes
the new interface transparent. The CC.PRG will also run by itself to drive
the Alcyon compiler. It accepts wildcards or multiple files on the command
line, can compiler or simply assemble a file. (It goes directly to the
assembler for any file with an `.S' file type.) It will link a group of